
<?php if(isset($_GET['idUnivers']))
{
	$rating=-1;
	$niveau = -1;
	$nbChapitres = -1;
	if(isset($_POST['rechercher'], $_POST['chRating'], $_POST['chChapitre'], $_POST['chNiveau'] )
	&&  ($_POST['chRating']=== "-1" || $_POST['chRating']=== "K" || $_POST['chRating']===  "K+"  || $_POST['chRating']===  "T"  || $_POST['chRating']===  "M"  || $_POST['chRating']===  "MA" )
	&&  ($_POST['chNiveau']=== "-1" || $_POST['chNiveau']==="2" || $_POST['chNiveau']=== "2-5"  || $_POST['chNiveau']=== "6-10"  || $_POST['chNiveau']=== "11-20"  || $_POST['chNiveau']=== "21-50" || $_POST['chNiveau']=== "+50" )
	&&  ($_POST['chChapitre']=== "-1" || $_POST['chChapitre']==="2" || $_POST['chChapitre']=== "2-5"  || $_POST['chChapitre']=== "6-10"  || $_POST['chChapitre']=== "11-30"  || $_POST['chChapitre']=== "31-60" || $_POST['chChapitre']=== "+60" )
	)
	{
	
		$rating=$_POST['chRating'];
		$niveau=$_POST['chNiveau'];
		$nbChapitres=$_POST['chChapitre'];
	}
	
?>
<form method="post" action="../Pages/histoire.php?<?php echo 'idUnivers=' . $_GET['idUnivers'] . ''?>">
	<div class="requete">
		<table border="0px" width="70%">
			<tr>
				<td>
					 <p>
						<label for="chRating">Rating :</label><br/>
						<select name="chRating" id="chRating">
							<option value="-1">Tous</option>
							<option value="K" <?php if($rating ==="K")  echo'selected="selected"'; ?> >K (5+)</option>
							<option value="K+"<?php if($rating ==="K+")  echo'selected="selected"'; ?> >K+ (9+)</option>
							<option value="T"<?php if($rating ==="T")  echo'selected="selected"'; ?> >T (13+)</option>
							<option value="M"<?php if($rating ==="M")  echo'selected="selected"'; ?> >M (16+)</option>
							<option value="MA"<?php if($rating ==="MA")  echo'selected="selected"'; ?> >MA (18+)</option>
						</select>
					</p>
				</td>
				<td>
					 <p>
						<label for="chNiveau">Niveau :</label><br/>
						<select name="chNiveau" id="chNiveau">
							<option value="-1">Tous</option>
							<option value="2" <?php if($niveau ==="2")  echo'selected="selected"'; ?> >2</option>
							<option value="2-5" <?php if($niveau ==="2-5")  echo'selected="selected"'; ?> >2-5</option>
							<option value="6-10" <?php if($niveau ==="6-10")  echo'selected="selected"'; ?> >6-10</option>
							<option value="11-20" <?php if($niveau ==="11-20")  echo'selected="selected"'; ?> >11-20</option>
							<option value="21-50" <?php if($niveau ==="21-50")  echo'selected="selected"'; ?> >21-50</option>
							<option value="+50" <?php if($niveau ==="+50")  echo'selected="selected"'; ?> >+50</option>
						</select>
					</p>
				</td>
				<td>
					 <p>
						<label for="chChapitre">Nb Chapitres :</label><br/>
						<select name="chChapitre" id="chChapitre">
							<option value="-1">Tous</option>
							<option value="2-5" <?php if($nbChapitres ==="2-5")  echo'selected="selected"'; ?> >2-5</option>
							<option value="6-10" <?php if($nbChapitres ==="6-10")  echo'selected="selected"'; ?> >6-10</option>
							<option value="11-30" <?php if($nbChapitres ==="11-30")  echo'selected="selected"'; ?> >11-30</option>
							<option value="31-60" <?php if($nbChapitres ==="31-60")  echo'selected="selected"'; ?> >31-60</option>
							<option value="+60" <?php if($nbChapitres ==="+60")  echo'selected="selected"'; ?> >+60</option>
						</select>
					</p>
				</td>
				<td>
						<input type="submit" value="Rechercher" name="rechercher" />
				</td>
			</tr>
		</table>
	</div>
</form>
<?php
}
?>
